home *** CD-ROM | disk | FTP | other *** search
/ Champak 138 / Volume 138 Aug 19 2011 - Damaged.iso / Games / hopes_babysitting_maze.swf / scripts / __Packages / Classes / bsmEntity.as < prev    next >
Text File  |  2011-08-19  |  1KB  |  64 lines

  1. class Classes.bsmEntity
  2. {
  3.    function bsmEntity(t_data, t_levelPath)
  4.    {
  5.       this.assetID = t_data.assetID;
  6.       this.x = t_data.x;
  7.       this.y = t_data.y;
  8.       this.levelPath = t_levelPath;
  9.       this.xMove = 0;
  10.       this.yMove = 0;
  11.    }
  12.    function spawn(t_path, t_depth)
  13.    {
  14.       this.path = t_path;
  15.       this.mc = t_path.attachMovie(this.assetID,this.assetID + t_depth,t_depth);
  16.       this.mc.stop();
  17.       this.placeAt(this.x,this.y);
  18.       this.hdWidth = this.baseWidth = this.mc._width;
  19.       this.hdHeight = this.baseHeight = this.mc._height;
  20.       this.hidden = false;
  21.       this.render();
  22.    }
  23.    function step(t_elapsed)
  24.    {
  25.       this.update(t_elapsed);
  26.       this.move();
  27.       this.render();
  28.    }
  29.    function update(t_elapsed)
  30.    {
  31.    }
  32.    function move()
  33.    {
  34.       this.x += this.xMove;
  35.       this.y += this.yMove;
  36.    }
  37.    function render()
  38.    {
  39.       this.mc._x = this.x - this.baseWidth / 2;
  40.       this.mc._y = this.y - this.baseHeight / 2;
  41.    }
  42.    function hide()
  43.    {
  44.       this.hidden = true;
  45.       this.mc._visible = false;
  46.    }
  47.    function show()
  48.    {
  49.       trace("SHOW");
  50.       this.hidden = false;
  51.       this.mc._visible = true;
  52.    }
  53.    function placeAt(t_x, t_y)
  54.    {
  55.       this.x = t_x;
  56.       this.y = t_y;
  57.    }
  58.    function clear()
  59.    {
  60.       this.mc.removeMovieClip();
  61.       false;
  62.    }
  63. }
  64.